package com.cloudkinto.service.order;

import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.OrderAmazonDo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.entity.OrderOutputDo;
import com.cloudkinto.service.order.vo.amazon.AmazonOrderDetailRes;
import com.cloudkinto.service.order.vo.amazon.AmazonOrderDownReq;
import com.cloudkinto.service.order.vo.amazon.OrderSPFulfillment;
import com.cloudkinto.service.order.vo.amazon.UpdateSysMemoReq;
import com.cloudkinto.service.order.vo.amazon.amazonorder.OrderFulfillment;
import com.cloudkinto.service.orderoutput.vo.OrderOutputAddReq;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  service接口
 * </p>
 * @author 张永远
 * @since 2020-06-02
 */
public interface OrderAmazonService extends IService<OrderAmazonDo> {

    SingleResult addInit(Long userId, Long companyId);

    SingleResult downloadAmazonOrdersSP(AmazonOrderDownReq req) throws Exception;

    SingleResult selectAmazonOrderApi(AmazonOrderDownReq req, Long userId, Long companyId) throws Exception;

    SingleResult downloadAmazonOrders(AmazonOrderDownReq req, Long userId, Long companyId) throws Exception;

    void exportExcel(Map<String, String> map, List<Long> ids, HttpServletResponse response) throws IOException;

    SingleResult markSendOut(List<Long> ids,Long userId);

    SingleResult updateSysMemo(UpdateSysMemoReq req,Long userId,Long companyId);

    SingleResult sendOut(String[] ids,Long userId, Long companyId,boolean isAuto);

    SingleResult sendOutNopackage(String id, Long userId, Long companyId);

    SingleResult sendOutMatch(List<OrderOutputAddReq> orderOutputAddReqList, Long userId);

    Object add(Object req, Long userId);

    int delete(Long id, Long userId);

    AmazonOrderDetailRes detail(Long id);

    SingleResult pageInit();

    PageResult getListPage(Map<String, String> map);

    List<OrderFulfillment> dealWithAmazonOrder(OrderOutputDo sendOutEntity);

    void uploadExpressNo2Amazon(Map<Long, List<OrderFulfillment>> orderFulfillments);

    void autoRefreshOrder();

    OrderSPFulfillment dealWithAmazonOrderSP(OrderOutputDo sendOutEntity);

    String getFeed(String feedId, String accessToken, String sessionToken, List<String> orderIds);

    SingleResult adToken(String code);

    void getFeedTest(int i, String s);
}
